index.md (3255B)
1 +++ 2 title = "Network: providing service" 3 +++ 4 5 # Network: providing service 6 **Congestion control** 7 Various approaches: 8 9 - network provisioning — preventing by increasing available bandwidth (like widening a road) 10 - traffic-aware routing — choose routes based on traffic, not just topology 11 - admission control — if there’s congestion, new traffic has to wait (like planes at an airport) 12 - traffic throttling — send messages back to indicate network congestion (e.g. special bits in IP packet, inform through TCP) 13 14 - end-to-end — destination sends choke signal, source receives it and slows down transmission 15 - link-by-link — destination sends choke signal, every router along the way slows down transmission 16 17 - load shedding — choose partial failure over total failure (that’s a good life motto) 18 19 - easy to implement, but packet loss will likely happen due to congestion 20 - Random Early Detection (RED) — drop packets randomly if buffer space is almost full, send implicit signal to sender to hold their horses 21 22 On a scale of slower preventative to faster reactive: 23 24 ![screenshot.png](06e48388142f4d221d9da4a465963447.png) 25 26 **Quality of service** 27 parameters of QoS: 28 29 - Bandwidth — max data rate, in bits per second (bps) 30 - Delay — time it takes from source to destination (sec) 31 - Jitter — variation in packet delay (constant delay is 0) 32 - Packet loss — probability of packets being dropped 33 34 To guarantee QoS (or at least try), you need to control the traffic through: 35 36 - controlling data rate 37 - packet scheduling 38 - admission control 39 40 Traffic shaping regulates rate and burstiness of data entering the network: 41 42 - Leaky bucket — sending rate is ≤R, max queue size is B: 43 44 ![screenshot.png](8aa004b3567888a8208933820d2c999c.png) 45 46 - Token bucket — limit average rate to R, limit short-term bursts up to B 47 48 ![screenshot.png](1035749358031d678c1264c845d5eaa4.png) 49 50 **Internetworking** 51 sending packets over multiple networks that use their own protocols 52 53 Tunnelling 54 55 - if source and destination use same protocols 56 57 - e.g. if host in Paris wants to send an IPv6 packet to an IPv6 host in London over the IPv4 internet, the IPv6 packet can be encapsulated inside of an IPv4 packet. 58 59 - or, if a car that can drive on a road is transport as freight from one road to another using a train 60 61 ![screenshot.png](cfaae45719ac155eb0b807eba95527a3.png) 62 63 Packet fragmentation 64 each network puts a maximum size on packets 65 size can be limited by hardware/software/protocols/law/… 66 e.g. max payload for 67 68 - 802.3 - 1500 B 69 70 - 802.11 - 2272 B 71 72 - IP - 65,515 B 73 74 - Transparent — packets are reassembled at every router 75 76 ![screenshot.png](88d5dbd2d37f003fb914f703360d0dab.png) 77 78 - Nontransparent — packets are reassembled only at final destination (host), this is what IP uses 79 80 ![screenshot.png](1b871ffc441fa461aab9632a90952296.png) 81 82 - path MTU (max transmission unit) discovery 83 - each IP packet is sent with header bits disallowing fragmentation 84 - if a router receives a packet that’s too large, it drops it and sends back an error packet with required size. 85 - source then uses info inside error packet to refragment the original packet into smaller pieces 86 87 ![screenshot.png](4180db441cdea253eb552b39e9116955.png)